package com.orphan.audit.dao;

import com.orphan.audit.po.GoodsInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.orphan.audit.po.SupplierInfo;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wdn
 * @since 2021-07-15
 */
@Mapper
public interface GoodsInfoMapper extends BaseMapper<GoodsInfo> {


    @Select("select * from t_goods_info")
    @Results(id = "goodsInfoMap",value = {
            @Result(column = "t_id",property = "tId",id = true),
            @Result(column = "t_goodsName",property = "tGoodsname"),
            @Result(column = "t_goodsNum",property = "tGoodsnum"),
            @Result(column = "t_type",property = "tType"),
            @Result(column = "t_price",property = "tPrice"),
            @Result(column = "t_status",property = "tStatus"),
            @Result(column = "fk_goods_order",property = "orderCheck",
                    one = @One(select = "com.orphan.audit.dao.OrderCheckMapper.getById",
                            fetchType = FetchType.LAZY))
    })
    List<GoodsInfo> findAll();
}
